Open
Conversation
Contributor
|
연구소 옛날에 시도했었는데, 저는 구현이 너무 어렵더라구요 |
Member
Author
저도 옛날에 시도했다가 못 푼 기억땜에 다시 도전했는데 이번엔 성공했네요. |
Contributor
|
어려워유ㅠ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. 14502
🔗 문제 링크
https://www.acmicpc.net/problem/14502
✔️ 소요된 시간
50m
✨ 수도 코드
벽 3개 세우는 걸 코드로 어떻게 옮길까 생각을 하던 중에 전에 idx를 사용해서 x,y좌표를 구하는 방식이 떠올라 사용했슴다!
dfs를 통해서 벽3개를 만들어준 상태에서 depth가 3이 됬을때 그 안에서 bfs를 돌아서 정답을 갱신하면 되요
처음에 else로 buildwall(idx+1, depth);
이 부분을 빼서 실패했었는데 왜 실패 했냐면 else로 빼서 처리하게 되면은
안 세우고 넘어가는 경우는 처리를 안하고 벽 세우는 경우만 탐색을 하게 됨
아래 부분은 디버깅용 배열을 확인하는 용도에요
📚 새롭게 알게된 내용
2. 2206
🔗 문제 링크
https://www.acmicpc.net/problem/2206
✔️ 소요된 시간
정답 참고(30분 고민)
✨ 수도 코드
벽을 부순 경우, 안 부순 경우를 다 생각하는걸 코드로 어떻게 변환할까 생각하다가 안 떠올라서 바로 정답을 참고 했습니다.
int dist[1005][1005][2];
[0] 벽을 하나도 안 부수고 (x,y)까지 오는데 걸리는 비용
[1] 벽을 하나만 부수고 (x,y)까지 오는데 걸리는 비용, (x,y)가 벽이라서 부수는 경우 포함
bfs틀은 비슷해서 주석 달아놓은것으로 이해되실거같습니다!
📚 새롭게 알게된 내용
상태를 3차원 배열에 추가로 넣는 방식의 문제를 어떻게 처리할지 새로 알았어요
tie로 변수를 받을 수 있어요
<참고>
https://github.com/encrypted-def/basic-algo-lecture/blob/master/0x09/solutions/2206.cpp